﻿USE [master]
GO
/****** Object:  Database [DLM]    Script Date: 07/11/2012 16:00:50 ******/
CREATE DATABASE [DLM] ON  PRIMARY 
( NAME = N'DLM', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'DLM_log', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [DLM].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [DLM] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [DLM] SET ANSI_NULLS OFF
GO
ALTER DATABASE [DLM] SET ANSI_PADDING OFF
GO
ALTER DATABASE [DLM] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [DLM] SET ARITHABORT OFF
GO
ALTER DATABASE [DLM] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [DLM] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [DLM] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [DLM] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [DLM] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [DLM] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [DLM] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [DLM] SET  DISABLE_BROKER
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [DLM] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [DLM] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [DLM] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [DLM] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [DLM] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [DLM] SET  READ_WRITE
GO
ALTER DATABASE [DLM] SET RECOVERY FULL
GO
ALTER DATABASE [DLM] SET  MULTI_USER
GO
ALTER DATABASE [DLM] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [DLM] SET DB_CHAINING OFF
GO
EXEC sys.sp_db_vardecimal_storage_format N'DLM', N'ON'
GO
USE [DLM]
GO
/****** Object:  Table [dbo].[Log]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Log](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[Date] [datetime] NOT NULL,
	[Level] [varchar](50) NULL,
	[Logger] [varchar](255) NULL,
	[Source] [nvarchar](255) NULL,
	[Message] [nvarchar](255) NULL,
 CONSTRAINT [PK_SystemLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Remark]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Remark](
	[RemarkID] [int] IDENTITY(1,1) NOT NULL,
	[PartyID] [int] NOT NULL,
	[UserID] [int] NOT NULL,
	[Content] [nvarchar](100) NULL,
	[Rate] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Remark] PRIMARY KEY CLUSTERED 
(
	[RemarkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Remark] ON
INSERT [dbo].[Remark] ([RemarkID], [PartyID], [UserID], [Content], [Rate], [CreateDate]) VALUES (1, 2, 2, N'dfdf', 8, CAST(0x0000A0890185D774 AS DateTime))
SET IDENTITY_INSERT [dbo].[Remark] OFF
/****** Object:  Table [dbo].[AdminUser]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminUser](
	[AdminID] [int] IDENTITY(1,1) NOT NULL,
	[Administrator] [nvarchar](30) NOT NULL,
	[Password] [varchar](max) NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_AdminUser] PRIMARY KEY CLUSTERED 
(
	[AdminID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[AdminUser] ON
INSERT [dbo].[AdminUser] ([AdminID], [Administrator], [Password], [CreateDate]) VALUES (1, N'admin', N'/q0FLu7c+zHEmxn5Ht3tJA==', CAST(0x0000A06F00000000 AS DateTime))
SET IDENTITY_INSERT [dbo].[AdminUser] OFF
/****** Object:  Table [dbo].[AdminLog]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[Action] [nvarchar](20) NOT NULL,
	[ActionDate] [datetime] NOT NULL,
	[ActionSourceIP] [varchar](20) NULL,
 CONSTRAINT [PK_AdminLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Account]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Account](
	[AccountID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Password] [varchar](max) NOT NULL,
	[Email] [varchar](30) NOT NULL,
	[ActiveCode] [varchar](50) NOT NULL,
	[IsActive] [bit] NOT NULL,
	[IsValidation] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Account] ON
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (1, N'ww', N'bs5P1RvBE5QmkmN9nUuGDg==', N'weiw@keysense.com.cn', N'2e407669-c12a-4044-b46b-ff72bc6c8964', 1, 1, CAST(0x0000A06F009FD485 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (2, N'ccx', N'bs5P1RvBE5QmkmN9nUuGDg==', N'weiw@keysense.com.cn', N'3dcb9d9a-11eb-4589-8102-6dcc4ed44849', 1, 1, CAST(0x0000A06F00A2C21C AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (3, N'weiwei', N'bs5P1RvBE5QmkmN9nUuGDg==', N'weiw@keysense.com.cn', N'43e4aac0-6644-4cb8-892d-c596c019024a', 1, 1, CAST(0x0000A06F00C2F210 AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (4, N'chencaixia', N'cGakD0J3acxDNHqpa3KTGg==', N'oyjd614@163.com', N'9b23d748-6167-4289-8dfe-2d3d259886c7', 0, 0, CAST(0x0000A08101064D5C AS DateTime))
SET IDENTITY_INSERT [dbo].[Account] OFF
/****** Object:  Table [dbo].[EmailInvitation]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EmailInvitation](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[UserID] [int] NOT NULL,
	[Email] [varchar](30) NULL,
	[Content] [ntext] NULL,
	[PartyID] [int] NOT NULL,
	[PartySubject] [nvarchar](30) NULL,
	[IsSent] [bit] NOT NULL,
	[SendDate] [datetime] NOT NULL,
 CONSTRAINT [PK_EmailInvitation] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[EmailInvitation] ON
INSERT [dbo].[EmailInvitation] ([ID], [AccountName], [UserID], [Email], [Content], [PartyID], [PartySubject], [IsSent], [SendDate]) VALUES (1, N'wwrr', 0, N'oyjd614@163.com', NULL, 1, N'踢足球', 1, CAST(0x0000A08100FFC37C AS DateTime))
INSERT [dbo].[EmailInvitation] ([ID], [AccountName], [UserID], [Email], [Content], [PartyID], [PartySubject], [IsSent], [SendDate]) VALUES (2, N'ww', 0, N'oyjd614@163.com', NULL, 4, N'ww', 1, CAST(0x0000A085015630E4 AS DateTime))
SET IDENTITY_INSERT [dbo].[EmailInvitation] OFF
/****** Object:  Table [dbo].[Country]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Country](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Country] [nvarchar](15) NULL,
	[Province] [nvarchar](15) NULL,
	[City] [nvarchar](10) NULL,
	[Zone] [nvarchar](10) NULL,
	[Town] [nvarchar](30) NULL,
	[ParentId] [int] NULL,
 CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BreakAppointment]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BreakAppointment](
	[BID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_BreakAppointment] PRIMARY KEY CLUSTERED 
(
	[BID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BonusRule]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BonusRule](
	[RuleID] [int] IDENTITY(1,1) NOT NULL,
	[TemporaryDistrain] [decimal](10, 2) NULL,
	[Distrain] [decimal](10, 2) NULL,
	[Drop] [decimal](10, 2) NULL,
	[Rate] [decimal](10, 2) NULL,
	[Publish] [decimal](10, 2) NULL,
	[Inviite] [decimal](10, 2) NULL,
 CONSTRAINT [PK_BonusRule] PRIMARY KEY CLUSTERED 
(
	[RuleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BonusLog]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BonusLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NULL,
	[Bonus] [decimal](10, 2) NULL,
	[CreateDate] [datetime] NULL,
 CONSTRAINT [PK_BonusLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[BonusLog] ON
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (1, 3, 1, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06F00C38630 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (2, 2, 1, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A07200C9DC3C AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (3, 2, 0, CAST(-2.00 AS Decimal(10, 2)), CAST(0x0000A08100B661E3 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (4, 3, 0, CAST(-2.00 AS Decimal(10, 2)), CAST(0x0000A08100B7FA66 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (5, 2, 1, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A082014BAE76 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (6, 3, 3, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08300B9B1B6 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (7, 1, 4, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08501561C07 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (8, 3, 4, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A085015684A8 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (9, 1, 0, CAST(-2.00 AS Decimal(10, 2)), CAST(0x0000A085015D3F7D AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (10, 1, 0, CAST(-2.00 AS Decimal(10, 2)), CAST(0x0000A085015D5349 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (11, 1, 0, CAST(-2.00 AS Decimal(10, 2)), CAST(0x0000A085015E1931 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (12, 2, 3, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08600EF8D31 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (13, 3, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A086013F1ED3 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (14, 3, 1, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08A0119B3DC AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (15, 3, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08A011A03EA AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (16, 3, 3, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08A011A2EE2 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (17, 3, 3, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08A011C0CF9 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (18, 2, 3, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A08A01864F0A AS DateTime))
SET IDENTITY_INSERT [dbo].[BonusLog] OFF
/****** Object:  Table [dbo].[PartyType]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PartyType](
	[PID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](20) NOT NULL,
	[Type] [int] NOT NULL,
 CONSTRAINT [PK_PartyType] PRIMARY KEY CLUSTERED 
(
	[PID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[PartyType] ON
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (1, N'体育活动', 0)
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (2, N'单身男女', 1)
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (3, N'老乡活动', 2)
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (4, N'其他', 3)
SET IDENTITY_INSERT [dbo].[PartyType] OFF
/****** Object:  Table [dbo].[Party]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Party](
	[PartyID] [int] IDENTITY(1,1) NOT NULL,
	[Status] [int] NOT NULL,
	[PartyType] [int] NOT NULL,
	[Subject] [nvarchar](30) NOT NULL,
	[Content] [ntext] NULL,
	[PhotoUrl] [nvarchar](20) NULL,
	[Modality] [nvarchar](20) NULL,
	[PartyDate] [datetime] NULL,
	[Location] [nvarchar](100) NULL,
	[Address] [nvarchar](150) NULL,
	[Area] [nvarchar](50) NULL,
	[CreateDate] [datetime] NOT NULL,
	[MemberCount] [int] NULL,
	[Expense] [decimal](10, 2) NULL,
	[PaymentType] [int] NOT NULL,
	[IsSuccess] [bit] NOT NULL,
 CONSTRAINT [PK_Party] PRIMARY KEY CLUSTERED 
(
	[PartyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Party] ON
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [CreateDate], [MemberCount], [Expense], [PaymentType], [IsSuccess]) VALUES (1, 1, 1, N'踢足球', N'体育馆踢足球', NULL, N'足球', CAST(0x0000A07300000000 AS DateTime), N'浦东张江中学', N'浦东路张江路128号', N',,', CAST(0x0000A06F00A512CA AS DateTime), 11, CAST(500.00 AS Decimal(10, 2)), 1, 1)
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [CreateDate], [MemberCount], [Expense], [PaymentType], [IsSuccess]) VALUES (2, 1, 2, N'唱歌', N'唱歌', NULL, N'唱歌', CAST(0x0000A07400000000 AS DateTime), N'阿玛达', N'张江路益江路', N',,', CAST(0x0000A06F00B32313 AS DateTime), 10, CAST(300.00 AS Decimal(10, 2)), 2, 1)
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [CreateDate], [MemberCount], [Expense], [PaymentType], [IsSuccess]) VALUES (3, 0, 1, N'羽毛球', N'对方答复', NULL, N'羽毛球', CAST(0x0000A0A000000000 AS DateTime), N'张江', N'浦东南路1835号', N'0,,', CAST(0x0000A08300B91977 AS DateTime), 6, CAST(70.00 AS Decimal(10, 2)), 1, 1)
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [CreateDate], [MemberCount], [Expense], [PaymentType], [IsSuccess]) VALUES (4, 0, 1, N'ww', N'wewe', NULL, N'1', CAST(0x0000A08900000000 AS DateTime), N'3', N'fffffffffffwww', N',,', CAST(0x0000A08501558271 AS DateTime), 11, CAST(1111.00 AS Decimal(10, 2)), 2, 1)
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [CreateDate], [MemberCount], [Expense], [PaymentType], [IsSuccess]) VALUES (5, 3, 3, N'dfdfdfdf', N'dfdf', NULL, N'dfd', CAST(0x0000A08600000000 AS DateTime), N'dfdf', N'其他', N',,', CAST(0x0000A0850187349A AS DateTime), 22, CAST(222.00 AS Decimal(10, 2)), 1, 0)
SET IDENTITY_INSERT [dbo].[Party] OFF
/****** Object:  Table [dbo].[Notice]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Notice](
	[NoticeID] [int] IDENTITY(1,1) NOT NULL,
	[Subject] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Notice] PRIMARY KEY CLUSTERED 
(
	[NoticeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Notice] ON
INSERT [dbo].[Notice] ([NoticeID], [Subject], [Content], [CreateDate]) VALUES (2, N'test', N'tttt', CAST(0x0000A082016AD071 AS DateTime))
SET IDENTITY_INSERT [dbo].[Notice] OFF
/****** Object:  Table [dbo].[Modality]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Modality](
	[MID] [int] IDENTITY(1,1) NOT NULL,
	[PID] [int] NOT NULL,
	[Name] [nvarchar](30) NOT NULL,
 CONSTRAINT [PK_Modality] PRIMARY KEY CLUSTERED 
(
	[MID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Modality] ON
INSERT [dbo].[Modality] ([MID], [PID], [Name]) VALUES (1, 1, N'踢足球')
SET IDENTITY_INSERT [dbo].[Modality] OFF
/****** Object:  Table [dbo].[User]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[AccountID] [int] NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Name] [nvarchar](20) NULL,
	[Gender] [bit] NULL,
	[Birthday] [datetime] NULL,
	[Age] [smallint] NULL,
	[Location] [nvarchar](20) NULL,
	[HomePlace] [nvarchar](30) NULL,
	[Marriage] [bit] NULL,
	[NativePlace] [nvarchar](40) NULL,
	[Stature] [nvarchar](10) NULL,
	[Weight] [int] NULL,
	[Education] [nvarchar](10) NULL,
	[Job] [nvarchar](20) NULL,
	[Income] [decimal](10, 2) NULL,
	[Position] [nvarchar](20) NULL,
	[Industry] [nvarchar](50) NULL,
	[Car] [bit] NULL,
	[Parents] [nvarchar](20) NULL,
	[Photo] [nvarchar](50) NULL,
	[Phone] [varchar](15) NULL,
	[IM] [varchar](18) NULL,
	[IsValidation] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_User_AccountID] UNIQUE NONCLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[User] ON
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [IsValidation], [CreateDate]) VALUES (1, 1, N'ww', N'魏伟', 0, CAST(0x0000798500000000 AS DateTime), NULL, N'上海', NULL, 0, N'新疆', N'170', 60, N'研究生', N'工程师', NULL, N'经理', N'IT行业', 0, N'良好', N'962.jpg', N'18217229563', N'46961159', 1, CAST(0x0000A06F009FD487 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [IsValidation], [CreateDate]) VALUES (2, 2, N'ccx', N'陈彩霞', 1, CAST(0x0000798500000000 AS DateTime), NULL, N'11', NULL, 0, N'22', N'160', 50, N'高中', N'工程师', NULL, N'dfdf', N'dfdf', 1, N'良好', N'952.jpg', NULL, NULL, 1, CAST(0x0000A06F00A2C21C AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [IsValidation], [CreateDate]) VALUES (3, 3, N'weiwei', N'tt', 0, CAST(0x0000798500000000 AS DateTime), NULL, N'11', NULL, 0, N'1', N'11', 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'910.jpg', NULL, NULL, 1, CAST(0x0000A06F00C2F210 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [IsValidation], [CreateDate]) VALUES (4, 4, N'chencaixia', NULL, 0, CAST(0x0000798500000000 AS DateTime), 22, N'11', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'test', NULL, NULL, 0, CAST(0x0000A08101064D5C AS DateTime))
SET IDENTITY_INSERT [dbo].[User] OFF
/****** Object:  Table [dbo].[UserView]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserView](
	[ViewID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[IP] [varchar](20) NULL,
	[ViewDate] [datetime] NOT NULL,
 CONSTRAINT [PK_UserView] PRIMARY KEY CLUSTERED 
(
	[ViewID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[UserView] ON
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (1, 1, N'::1', CAST(0x0000A07F010EF614 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (2, 1, N'::1', CAST(0x0000A080017BA2EB AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (3, 2, N'::1', CAST(0x0000A08101695D35 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (4, 2, N'::1', CAST(0x0000A081016A2285 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (5, 2, N'::1', CAST(0x0000A0820108F43E AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (6, 3, N'::1', CAST(0x0000A0820108FA67 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (7, 3, N'::1', CAST(0x0000A0820109055D AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (8, 3, N'::1', CAST(0x0000A082010FB594 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (9, 2, N'::1', CAST(0x0000A082010FBC30 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (10, 3, N'::1', CAST(0x0000A08300B9C25B AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (11, 3, N'::1', CAST(0x0000A08300B9CA38 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (12, 3, N'::1', CAST(0x0000A08300BBAFAB AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (13, 3, N'::1', CAST(0x0000A08501042A02 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (14, 3, N'::1', CAST(0x0000A0850104F26F AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (15, 1, N'::1', CAST(0x0000A0850105A644 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (16, 1, N'::1', CAST(0x0000A0850105CD9F AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (17, 1, N'::1', CAST(0x0000A0850106B126 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (18, 1, N'::1', CAST(0x0000A08501075A3F AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (19, 3, N'::1', CAST(0x0000A08501539A57 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (20, 1, N'192.168.0.101', CAST(0x0000A0850156B82C AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (21, 1, N'192.168.0.101', CAST(0x0000A08501680061 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (22, 1, N'192.168.0.101', CAST(0x0000A08501686AC5 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (23, 1, N'::1', CAST(0x0000A085016B00E2 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (24, 1, N'::1', CAST(0x0000A0850172A1FA AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (25, 1, N'::1', CAST(0x0000A086010225BE AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (26, 1, N'::1', CAST(0x0000A0860102622E AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (27, 1, N'::1', CAST(0x0000A0860102A6A4 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (28, 3, N'192.168.0.101', CAST(0x0000A086013C43E1 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (29, 1, N'192.168.0.101', CAST(0x0000A086013CC609 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (30, 3, N'192.168.0.101', CAST(0x0000A086013D3047 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (31, 3, N'192.168.0.101', CAST(0x0000A086013DA332 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (32, 1, N'192.168.0.101', CAST(0x0000A0860140EB57 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (33, 1, N'192.168.0.101', CAST(0x0000A08601414F23 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (34, 1, N'192.168.0.101', CAST(0x0000A08601417D88 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (35, 2, N'192.168.0.101', CAST(0x0000A0860141929F AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (36, 2, N'192.168.0.101', CAST(0x0000A0860145988B AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (37, 3, N'::1', CAST(0x0000A089015F378A AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (38, 3, N'::1', CAST(0x0000A08901619FC4 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (39, 1, N'::1', CAST(0x0000A089016A1034 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (40, 1, N'::1', CAST(0x0000A089016A22B4 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (41, 3, N'::1', CAST(0x0000A08901707700 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (42, 1, N'::1', CAST(0x0000A0890171BC01 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (43, 3, N'::1', CAST(0x0000A0890172F6A6 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (44, 1, N'::1', CAST(0x0000A08901783E2B AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (45, 3, N'::1', CAST(0x0000A089017844E2 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (46, 3, N'::1', CAST(0x0000A08901788776 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (47, 3, N'::1', CAST(0x0000A08901789742 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (48, 3, N'::1', CAST(0x0000A08901790FE9 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (49, 1, N'::1', CAST(0x0000A08A00AEDBAB AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (50, 2, N'::1', CAST(0x0000A08A00B8AD7B AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (51, 2, N'::1', CAST(0x0000A08A00BDF8C2 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (52, 1, N'::1', CAST(0x0000A08A0121E521 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (53, 2, N'::1', CAST(0x0000A08A01798C81 AS DateTime))
SET IDENTITY_INSERT [dbo].[UserView] OFF
/****** Object:  Table [dbo].[UserPartyAssociation]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserPartyAssociation](
	[UPAID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsLead] [bigint] NULL,
	[AssociationDate] [datetime] NOT NULL,
 CONSTRAINT [PK_UserPartyAssociation] PRIMARY KEY CLUSTERED 
(
	[UPAID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] ON
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (1, 1, 1, 1, CAST(0x0000A06F00A512D1 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (2, 2, 2, 1, CAST(0x0000A06F00B32322 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (5, 1, 3, 1, CAST(0x0000A08300B9197E AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (7, 2, 4, 1, CAST(0x0000A08501558274 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (8, 1, 4, 0, CAST(0x0000A08501561BF5 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (9, 3, 4, 0, CAST(0x0000A0850156849B AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (10, 3, 5, 1, CAST(0x0000A085018734AE AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (11, 1, 3, 0, CAST(0x0000A086000F46C4 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (14, 3, 3, 0, CAST(0x0000A08A011C0C47 AS DateTime))
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] OFF
/****** Object:  Table [dbo].[Photo]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Photo](
	[PhotoID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Url] [nvarchar](30) NULL,
	[Desc] [nvarchar](20) NULL,
	[IsMain] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Photo] PRIMARY KEY CLUSTERED 
(
	[PhotoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Photo] ON
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (5, 2, N'571.jpg', N'', 0, CAST(0x0000A06F00A32778 AS DateTime))
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (34, 1, N'308.jpg', N'', 0, CAST(0x0000A084015E44B9 AS DateTime))
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (36, 3, N'573.jpg', N'', 0, CAST(0x0000A0850168433C AS DateTime))
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (37, 3, N'910.jpg', N'', 0, CAST(0x0000A08501685409 AS DateTime))
SET IDENTITY_INSERT [dbo].[Photo] OFF
/****** Object:  Table [dbo].[Invitation]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Invitation](
	[InvitationID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
	[SenderID] [int] NOT NULL,
	[SenderAccount] [nvarchar](25) NOT NULL,
	[InviteDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Invitation] PRIMARY KEY CLUSTERED 
(
	[InvitationID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Invitation] ON
INSERT [dbo].[Invitation] ([InvitationID], [UserID], [PartyID], [IsConfirmed], [SenderID], [SenderAccount], [InviteDate]) VALUES (2, 1, 3, 1, 3, N'weiwei', CAST(0x0000A0860004DAED AS DateTime))
SET IDENTITY_INSERT [dbo].[Invitation] OFF
/****** Object:  Table [dbo].[Friend]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Friend](
	[FriendID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[MyFriendID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
 CONSTRAINT [PK_Friend] PRIMARY KEY CLUSTERED 
(
	[FriendID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Friend] ON
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (5, 1, 2, CAST(0x0000A08100C1F160 AS DateTime), 1)
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (6, 2, 1, CAST(0x0000A08100C61F1D AS DateTime), 1)
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (7, 1, 3, CAST(0x0000A0850153A3B3 AS DateTime), 1)
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (8, 3, 1, CAST(0x0000A085015665CD AS DateTime), 1)
SET IDENTITY_INSERT [dbo].[Friend] OFF
/****** Object:  Table [dbo].[Supplier]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Supplier](
	[SID] [int] IDENTITY(1,1) NOT NULL,
	[MID] [int] NOT NULL,
	[Name] [nvarchar](30) NOT NULL,
	[Address] [ntext] NULL,
	[Phone] [varchar](20) NULL,
	[Order] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Supplier] PRIMARY KEY CLUSTERED 
(
	[SID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Supplier] ON
INSERT [dbo].[Supplier] ([SID], [MID], [Name], [Address], [Phone], [Order], [CreateDate]) VALUES (3, 1, N'www', N'11', N'11', 1, CAST(0x0000A07E00AE0068 AS DateTime))
INSERT [dbo].[Supplier] ([SID], [MID], [Name], [Address], [Phone], [Order], [CreateDate]) VALUES (4, 1, N'shanghaidongfang', N'dddd', N'123456', 0, CAST(0x0000A086014FD11C AS DateTime))
SET IDENTITY_INSERT [dbo].[Supplier] OFF
/****** Object:  Table [dbo].[Salutation]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Salutation](
	[SID] [int] IDENTITY(1,1) NOT NULL,
	[Type] [int] NOT NULL,
	[UserID] [int] NOT NULL,
	[GreetID] [int] NOT NULL,
	[Message] [nvarchar](50) NULL,
	[IsConfirm] [bit] NOT NULL,
	[SentDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Salutation] PRIMARY KEY CLUSTERED 
(
	[SID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Salutation] ON
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (1, 0, 2, 3, NULL, 1, CAST(0x0000A06F00C9BE6D AS DateTime))
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (2, 0, 2, 3, NULL, 1, CAST(0x0000A06F00DFD42F AS DateTime))
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (3, 0, 1, 3, NULL, 1, CAST(0x0000A06F00E6F13B AS DateTime))
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (4, 0, 1, 3, NULL, 1, CAST(0x0000A06F00E7C762 AS DateTime))
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (5, 1, 1, 1, N'', 1, CAST(0x0000A07200E11E4F AS DateTime))
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (6, 1, 1, 1, N'', 1, CAST(0x0000A07200E3778E AS DateTime))
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (7, 2, 1, 2, N'', 1, CAST(0x0000A07200E83AB0 AS DateTime))
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (8, 1, 3, 1, N'', 1, CAST(0x0000A08501566EE1 AS DateTime))
SET IDENTITY_INSERT [dbo].[Salutation] OFF
/****** Object:  Table [dbo].[Message]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Message](
	[MessageID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Title] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[IsRead] [bit] NOT NULL,
	[Source] [nvarchar](20) NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED 
(
	[MessageID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Message] ON
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (6, 2, N'ww加您为好友', N'ww 加您为好友,快去看看吧', 0, N'好友', CAST(0x0000A08100C2009A AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (7, 2, N'好友响应', N'您的好友请求被通过！', 0, N'好友', CAST(0x0000A08100C271DF AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (8, 3, N'ww加您为好友', N'ww 加您为好友,快去看看吧', 0, N'好友', CAST(0x0000A0850153A3BE AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (11, 3, N'好友响应', N'您的好友请求被通过！', 0, N'好友', CAST(0x0000A08501569C15 AS DateTime))
SET IDENTITY_INSERT [dbo].[Message] OFF
/****** Object:  Table [dbo].[Bonus]    Script Date: 07/11/2012 16:00:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Bonus](
	[BonusID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Bonus] [decimal](10, 2) NULL,
	[UpdateDate] [datetime] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Bonus] PRIMARY KEY CLUSTERED 
(
	[BonusID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_Bonus_UserID] UNIQUE NONCLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Bonus] ON
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (1, 1, CAST(29.00 AS Decimal(10, 2)), CAST(0x0000A085015E192D AS DateTime), CAST(0x0000A06F009FD521 AS DateTime))
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (2, 2, CAST(27.00 AS Decimal(10, 2)), CAST(0x0000A08A01864E94 AS DateTime), CAST(0x0000A06F00A2C224 AS DateTime))
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (3, 3, CAST(6.00 AS Decimal(10, 2)), CAST(0x0000A08A011C0CF4 AS DateTime), CAST(0x0000A06F00C2F2BF AS DateTime))
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (4, 4, CAST(50.00 AS Decimal(10, 2)), CAST(0x0000A08101064E1E AS DateTime), CAST(0x0000A08101064E1E AS DateTime))
SET IDENTITY_INSERT [dbo].[Bonus] OFF
/****** Object:  ForeignKey [FK_Modality_PartyType]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Modality]  WITH CHECK ADD  CONSTRAINT [FK_Modality_PartyType] FOREIGN KEY([PID])
REFERENCES [dbo].[PartyType] ([PID])
GO
ALTER TABLE [dbo].[Modality] CHECK CONSTRAINT [FK_Modality_PartyType]
GO
/****** Object:  ForeignKey [FK_User_Account]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[User]  WITH CHECK ADD  CONSTRAINT [FK_User_Account] FOREIGN KEY([AccountID])
REFERENCES [dbo].[Account] ([AccountID])
GO
ALTER TABLE [dbo].[User] CHECK CONSTRAINT [FK_User_Account]
GO
/****** Object:  ForeignKey [FK_UserView_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[UserView]  WITH CHECK ADD  CONSTRAINT [FK_UserView_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserView] CHECK CONSTRAINT [FK_UserView_User]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_Party]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_Party] FOREIGN KEY([PartyID])
REFERENCES [dbo].[Party] ([PartyID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_Party]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_User]
GO
/****** Object:  ForeignKey [FK_Photo_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Photo]  WITH CHECK ADD  CONSTRAINT [FK_Photo_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Photo] CHECK CONSTRAINT [FK_Photo_User]
GO
/****** Object:  ForeignKey [FK_Invitation_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Invitation]  WITH CHECK ADD  CONSTRAINT [FK_Invitation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Invitation] CHECK CONSTRAINT [FK_Invitation_User]
GO
/****** Object:  ForeignKey [FK_Friend_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Friend]  WITH CHECK ADD  CONSTRAINT [FK_Friend_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Friend] CHECK CONSTRAINT [FK_Friend_User]
GO
/****** Object:  ForeignKey [FK_Supplier_Modality]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Supplier]  WITH CHECK ADD  CONSTRAINT [FK_Supplier_Modality] FOREIGN KEY([MID])
REFERENCES [dbo].[Modality] ([MID])
GO
ALTER TABLE [dbo].[Supplier] CHECK CONSTRAINT [FK_Supplier_Modality]
GO
/****** Object:  ForeignKey [FK_Salutation_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Salutation]  WITH CHECK ADD  CONSTRAINT [FK_Salutation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Salutation] CHECK CONSTRAINT [FK_Salutation_User]
GO
/****** Object:  ForeignKey [FK_Message_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Message]  WITH CHECK ADD  CONSTRAINT [FK_Message_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Message] CHECK CONSTRAINT [FK_Message_User]
GO
/****** Object:  ForeignKey [FK_Bonus_User]    Script Date: 07/11/2012 16:00:51 ******/
ALTER TABLE [dbo].[Bonus]  WITH CHECK ADD  CONSTRAINT [FK_Bonus_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Bonus] CHECK CONSTRAINT [FK_Bonus_User]
GO
